package com.yyysj.system.controller;

import com.yyysj.common.core.domain.Result;
import com.yyysj.common.core.domain.TableDataInfo;
import com.yyysj.system.domain.dto.UserDTO;
import com.yyysj.system.domain.dto.UserQueryDTO;
import com.yyysj.system.service.IUserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
@RequiredArgsConstructor
public class UserController {

    private final IUserService userService;

    @GetMapping("/list")
    public TableDataInfo list(UserQueryDTO userQueryDTO) {
        return userService.list(userQueryDTO);
    }

    @PutMapping("/updateStatus")
    public Result<?> updateStatus(@RequestBody UserDTO userDTO) {
        return Result.build(userService.updateStatus(userDTO));
    }
}
